package com.cw.recommend.common.util

import com.cw.recommend.common.constant.MODEL_PATH

import java.io.File

object FileUtil {

  def main(args: Array[String]): Unit = {
    deleteDir(MODEL_PATH)
  }


  def deleteDir(filePath: String) = {

    def aux(file: File): Unit = {
      if (file.isDirectory)  {
        file.listFiles.foreach { f =>
          if (f.isFile) f.delete()
          else aux(f)
        }
        file.delete()
      }else {
       file.delete()
      }
    }
    aux(new File(filePath))
  }


}
